<template>
	<view >
		<view>
			<button @click="uploadImg" type="primary">选择照片</button>
			<view>
				<image v-for="item in imgarr" :src="item" @click="showImg(item)"></image>
			</view>
			
		</view>
		<view class="view02" hover-class="view02_active" hover-start-time="2000">
			<view class="view01" hover-stay-time="4000"  hover-class="view01_active" hover-stop-propagation></view>				
		</view>
		<view>
			<button size="mini" type="warn">ok</button>
			<button size="mini" type="primary">ok</button>
			<button size="mini" type="default">ok</button>
		</view>
		<view>
			<button plain="true" size="default" type="warn">ok</button>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<view>
			<button disabled="true" size="default" type="primary">ok</button>
		</view>
		<!-- #endif -->
		<!-- #ifdef H5 -->
		<view>
			<button loading="true" size="default" type="warn">ok</button>	
		</view>
		<!-- #endif -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				imgarr:[]
			}
		},
		onLoad() {
			console.log("on Load函数触发")
			// #ifdef H5
			console.log("H5页面上的显示")
			// #endif
			// #ifdef MP-WEIXIN
			console.log("微信小程序上面的显示")
			// #endif
		},
		onShow(){
			console.log("on Show函数触发") 
		},
		onHide(){
			console.log("on Hide函数触发") 
		},
		onReady(){
			console.log("on Ready函数触发") 
		}
		,
		methods: {
			showImg(imgurl){
				uni.previewImage({
					current:imgurl,
					urls:this.imgarr
				})
			},
			uploadImg(){
				var that=this
				uni.chooseImage({
					count:9,
					success(res) {
						console.log(that.imgarr)
						console.log(res)
						that.imgarr=res.tempFilePaths
					}
				})
			}

		}
	}
</script>

<style>
	/* #ifdef H5 */
	.view01{
		width: 200rpx;
		height: 200rpx;
		background-color: red
		;
	}
	/* #endif */
	/* #ifdef MP-WEIXIN */
	.view01{
		width: 200rpx;
		height: 200rpx;
		background-color: #226699
		;
	}
	/* #endif */
	
	.view01_active{
		background-color: blue;
	}
	.view02{
		width: 400rpx;
		height: 400rpx;
		background-color: yellow
		;
	}
	.view02_active{
		background-color: green;
	}

</style>
